package game.action;

import game.Client;

/**
 * 下线、上线
 */
public class ReconnectAction extends ActionBase {

    private int count = 0;

    public ReconnectAction() {
        super(5000, 10000);
    }

    @Override
    public void action(Client client) {
        if (count % 2 == 0) {
            //主动断开链接
            client.close();
        } else {
            //重新链接服务器
            client.Start();
        }
        count++;
    }
}
